home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Imaging / PolygonClipper / PGCommon.h next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  1.9 KB  |  92 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        PGCommon.h
  3.  
  4.     Contains:    Common definitions for the polygon clipper.
  5.  
  6.     Written by:    Jens Alfke (based on algorithm by A. C. Kilgour)
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>     12/5/94    jpa        Code review fixes. [1203923]
  13.          <1>     6/15/94    jpa        first checked in
  14.          ---------------------------Moved to ODSOM project.
  15.          <1>      5/9/94    jpa        first checked in
  16. */
  17.  
  18.  
  19. #ifndef _PGCOMMON_
  20. #define _PGCOMMON_
  21.  
  22. #ifndef _ODTYPES_
  23. #include "ODTypes.h"
  24. #endif
  25.  
  26. #ifndef _EXCEPT_
  27. #include "Except.h"
  28. #endif
  29.  
  30.  
  31. //=============================================================================
  32. // Debugging
  33. //=============================================================================
  34.  
  35. #ifdef __MWERKS__
  36. #undef PROFILING
  37. #define PROFILING 0                    /* 1 enables Metrowerks profiling, 0 disables it*/
  38. #endif
  39.  
  40. #if PROFILING
  41.     #pragma profile on
  42.     #define LOGGING 0                /* Never log while profiling*/
  43. #else
  44. //    #undef LOGGING
  45. //    #define LOGGING 0                /* 1 enables logging, 0 disables it*/
  46. #endif
  47.  
  48. #define BEGINLOG
  49. #define ENDLOG
  50.  
  51. #define kPGAssertionFailed 7734
  52.  
  53. #if LOGGING
  54. #define PGASSERT(COND)    WASSERT(COND)
  55. #else
  56. #define PGASSERT(COND)    ASSERT(COND,kODErrAssertionFailed)
  57. #endif
  58.  
  59.  
  60. //=============================================================================
  61. // Constants & Types
  62. //=============================================================================
  63.  
  64.  
  65. typedef enum {
  66.     kNegative = -1,
  67.     kZero     =  0,
  68.     kPositive =  1
  69. } PGSense;
  70.  
  71.  
  72. typedef enum {
  73.     kLeft    = -1,
  74.     kOnTop    =  0,
  75.     kRight    =  1
  76. } PGSide;
  77.  
  78.  
  79. //=============================================================================
  80. // Globals
  81. //=============================================================================
  82.  
  83.  
  84. class PGContourList;
  85.  
  86.  
  87. extern ODSLong    gMinWrap, gMaxWrap;            // Min/max wrap desired for output
  88.  
  89. extern PGContourList *gOutputContours;        // GLOBAL: Collects output contours
  90.  
  91.  
  92. #endif /*_PGCOMMON*/